<template>
  <div class="app-container">
    <el-card class="box-card">
      <el-form ref="form" :model="form" >
        <el-descriptions title="读者信息" style="text-align: center" :column="2" border >
          <el-descriptions-item :contentStyle="contentStyle"label="姓名" :span="1"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.username}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="部职别" :span="1" label-class-name="my-label" :labelStyle="labelStyle" >
           {{form.identifier}}</el-descriptions-item>

          <el-descriptions-item :contentStyle="contentStyle" label="生日" :span="1"  label-class-name="my-label" :labelStyle="labelStyle" >
           {{form.birth}}</el-descriptions-item>


          <el-descriptions-item :contentStyle="contentStyle"label="性别" :span="1"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.gender}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="年龄" :span="1"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.age}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="单位部门" :span="1" label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.department}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="身份证号" :span="1" label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.idNumber}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="联系方式" :span="1" label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.contacttype}}</el-descriptions-item>
<!--          <el-descriptions-item :contentStyle="contentStyle" label="类别" :span="1" label-class-name="my-label" :labelStyle="labelStyle" >-->
<!--            {{form.userCategory}}</el-descriptions-item>-->
<!--          <el-descriptions-item :contentStyle="contentStyle" label="地图条码" :span="1" label-class-name="my-label" :labelStyle="labelStyle" >-->
<!--            <el-button @click="hadledownload">下载</el-button></el-descriptions-item>-->
        </el-descriptions>
        <br/>
        <el-descriptions  title="备注" style="text-align: center" :column="2" border >
          <el-descriptions-item :contentStyle="contentStyle" label="备注" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >
            {{ form.remark}}</el-descriptions-item>


        </el-descriptions>

      </el-form>
      <br/>
      <div style="float:right; margin-bottom: 15px;">
        <el-button @click="viewCancel">返 回</el-button>
      </div>
    </el-card>
  </div>
</template>
<script>
import { getBaseinfo } from "@/api/group/sb/baseinfo";

import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import watermark from "watermark-dom";
import {treeselect} from "@/api/system/dept";
  export default {
    name: "Map",
    data() {
      return {
        contentStyle:{
          'width':'200px'
        },
        form:{},
        labelStyle: { 'width': '12%','color': '#000000','text-align': 'right', },
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: false,
        // 总条数
        total: 0,
        // 部门树选项
        deptOptions: undefined,
        // 合同资料表格数据
        fileList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
      };
    },
    mounted() {
      watermark.load({ watermark_txt: "  "   });
    },
    created() {
      const id = this.$route.query.id;
      if (id) {
        // 获取表详细信息

        getBaseinfo(id).then(res => {

          this.form = res.data;
        });

      }
    },
    methods: {


      /** 关闭按钮 */
      viewCancel() {
        const id = this.$route.query.id;
        getBaseinfo(id).then(response => {
          this.form = response.data;
        });
        const obj = { path: "/basedata/reader", query: {id} };
        this.$tab.closeOpenPage(obj);
      },
     /* hadledownload(){
        const resource=this.form.enclosure;
        console.log(this.form.enclosure+"path");
        this.$download.resource(resource);
      },*/
      /** 查询部门下拉树结构 */
      getTreeselect() {
        treeselect().then(response => {
          this.deptOptions = response.data;
        });
      }
    },
  };
</script>






